int* intersection(int* nums1, int nums1Size, int* nums2, int nums2Size, int* returnSize) {
    int* a = (int*)malloc(sizeof(int) * (nums1Size + nums2Size));
    int flag = 0;
    int n = 0;
    for (int i = 0; i < nums1Size; i++)
    {
        flag = 0;
        for (int j = 0; j < nums2Size; j++)
        {
            if (nums1[i] == nums2[j])
            {
                flag = 1;
                nums2[j] = 1001;
            }
        }

        if (flag == 1)
        {
            a[n++] = nums1[i];
        }
    }
    *returnSize = n;
    return a;
}